package com.smedi.ismedi.inmail.core.domain.repository;

import com.smedi.ismedi.inmail.core.domain.aggregatemodel.announcement.AnnouncementOrganizationRelationship;
import com.smedi.ismedi.inmail.core.domain.aggregatemodel.announcement.OrganizationReadInfo;

import java.util.List;

/**
 * 主体院关系表仓库
 *
 * @author jiangqinxuan
 * @date 2021/07/27
 */
public interface AnnouncementOrganizationRelationshipRepository {
    /**
     * 公告与主体院关系表的插入接口
     *
     * @param announcementOrganizationRelationship 通知公告与主体院关系业务类
     */
    void doInsert(AnnouncementOrganizationRelationship announcementOrganizationRelationship);

    /**
     * 查询公告与组织关系是否已经存在
     *
     * @param announcementId   通知公告id
     * @param organizationName 组织名字
     * @return Boolean
     */
    Boolean doQueryStatusByAnnouncementIdAndOrganizationName(Long announcementId, String organizationName);

    /**
     * 依据公告id查询已读信息
     *
     * @param announcementId 通知公告与主体院关系业务类
     * @return OrganizationReadInfo
     */
    OrganizationReadInfo doSelectReadInfo(Long announcementId);

    /**
     * 依据负责的组织名称更改已读信息
     *
     * @param organizationName 当前登陆人负责的组织名称列表
     * @param announcementId   通知公告id
     */
    void doUpdateReadByOrganizationNameAndAnnouncementId(List<String> organizationName, Long announcementId);
}
